import tkinter as tk
root=tk.Tk()
root.title('神奇的锅')
import random
root.geometry('720x720')

def cook():
    m=0
    n=zonghe()
    if checkvar1.get()==1 and checkvar2.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='番茄炒蛋'
        else:
            jieguo='番茄蛋花汤'
    elif checkvar1.get()==1 and checkvar3.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='罗宋汤'
        else:
            jieguo='薯条与番茄酱'
    elif checkvar4.get()==1 and checkvar5.get()==1 and checkvar6.get()==1 and n==3:
        m=random.randint(0,1)
        if m==0:
            jieguo='芹菜香干炒肉丝'
        else:
            jieguo='拔苗猪长'
    elif checkvar7.get()==1 and checkvar8.get()==1 and n==2:
        jieguo='冬瓜虾皮汤'
    elif checkvar9.get()==1 and checkvar10.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='家常炒双菇'
        else:
            jieguo='保卫菇菇'
    elif checkvar11.get()==1 and checkvar12.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='清炒西蓝花'
        else:
            jieguo='红配绿'
    elif checkvar3.get()==1 and checkvar13.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='土豆烧排骨'
        else:
            jieguo='炸排排与炸条条'
    elif checkvar6.get()==1 and checkvar14.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='麻婆豆腐'
        else:
            jieguo='猪飞豆跑'
    elif checkvar12.get()==1 and checkvar15.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='胡萝卜炖鸡'
        else:
            jieguo='保卫萝卜'
    elif checkvar16.get()==1 and checkvar17.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='青椒牛柳'
        else:
            jieguo='豪华青椒酿肉'
    elif checkvar6.get()==1 and checkvar16.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='青椒炒肉丝'
        else:
            jieguo='普通青椒酿肉'
    elif checkvar6.get()==1 and checkvar12.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='锅包肉'
        else:
            jieguo='猪拱萝卜'
    elif checkvar15.get()==1 and checkvar18.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='宫保鸡丁'
        else:
            jieguo='小鸡吃黄瓜'
    elif checkvar2.get()==1 and checkvar18.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='黄瓜炒蛋'
        else:
            jieguo='瓜分鸡蛋'
    elif checkvar6.get()==1 and checkvar12.get()==1 and checkvar19.get()==1 and n==3:
        m=random.randint(0,1)
        if m==0:
            jieguo='鱼香肉丝'
        else:
            jieguo='猪吃双素'
    elif checkvar6.get()==1 and checkvar20.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='蒜苗炒肉'
        else:
            jieguo='猪顶绿苗'
    elif checkvar6.get()==1 and checkvar21.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='鱼香肉丝'
        else:
            jieguo='猪吃鱼'
    elif checkvar6.get()==1 and checkvar17.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='猪牛打架'
        else:
            jieguo='肉管煲'
    elif checkvar21.get()==1 and checkvar22.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='鱼虾煲'
        else:
            jieguo='双双被吃的海鲜兄弟'
    elif checkvar2.get()==1 and checkvar21.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='虾扯蛋'
        else:
            jieguo='虾啊！高蛋白！'
    elif checkvar2.get()==1 and checkvar15.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='亲子套餐'
        else:
            jieguo='母子相见'
    elif checkvar7.get()==1 and checkvar18.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='黄冬黄冬锵'
        else:
            jieguo='双瓜合璧天下无敌'
    elif checkvar1.get()==1 and checkvar18.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='茄黄'
        else:
            jieguo='凉拌菜 多吃菜'
    elif checkvar1.get()==1 and checkvar7.get()==1 and n==2:
        jieguo='番茄冬瓜汤'
    elif checkvar14.get()==1 and checkvar17.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='豆腐酿肉'
        else:
            jieguo='牛吃豆腐'
    elif checkvar12.get()==1 and checkvar13.get()==1 and n==2:
        m=random.randint(0,1)
        if m==0:
            jieguo='萝卜排骨汤'
        else:
            jieguo='排骨炖萝卜'
    else:
        jieguo='你弄的啥玩意啊'
    label.config(text=jieguo,fg='#FF7F00')
    
def zonghe():
    global he
    he=0
    lst1=[]
    lst1.append(checkvar1.get())
    lst1.append(checkvar2.get())
    lst1.append(checkvar3.get())
    lst1.append(checkvar4.get())
    lst1.append(checkvar5.get())
    lst1.append(checkvar6.get())
    lst1.append(checkvar7.get())
    lst1.append(checkvar8.get())
    lst1.append(checkvar9.get())
    lst1.append(checkvar10.get())
    lst1.append(checkvar11.get())
    lst1.append(checkvar12.get())
    lst1.append(checkvar13.get())
    lst1.append(checkvar14.get())
    lst1.append(checkvar15.get())
    lst1.append(checkvar16.get())
    lst1.append(checkvar17.get())
    lst1.append(checkvar18.get())
    lst1.append(checkvar19.get())
    lst1.append(checkvar20.get())
    lst1.append(checkvar21.get())
    lst1.append(checkvar22.get())
    lst1.append(checkvar23.get())
    lst1.append(checkvar24.get())
    for i in range(0,24):
        he=he+lst1[i]
    return he


def qingkong():
    a1.deselect()
    a2.deselect()
    a3.deselect()
    a4.deselect()
    a5.deselect()
    a6.deselect()
    a7.deselect()
    a8.deselect()
    a9.deselect()
    a10.deselect()
    a11.deselect()
    a12.deselect()
    a13.deselect()
    a14.deselect()
    a15.deselect()
    a16.deselect()
    a17.deselect()
    a18.deselect()
    a19.deselect()
    a20.deselect()
    a21.deselect()
    a22.deselect()
    a23.deselect()
    a24.deselect()
    label.config(text='')
    
checkvar1=tk.IntVar()
checkvar2=tk.IntVar()
checkvar3=tk.IntVar()
checkvar4=tk.IntVar()
checkvar5=tk.IntVar()
checkvar6=tk.IntVar()
checkvar7=tk.IntVar()
checkvar8=tk.IntVar()
checkvar9=tk.IntVar()
checkvar10=tk.IntVar()
checkvar11=tk.IntVar()
checkvar12=tk.IntVar()
checkvar13=tk.IntVar()
checkvar14=tk.IntVar()
checkvar15=tk.IntVar()
checkvar16=tk.IntVar()
checkvar17=tk.IntVar()
checkvar18=tk.IntVar()
checkvar19=tk.IntVar()
checkvar20=tk.IntVar()
checkvar21=tk.IntVar()
checkvar22=tk.IntVar()
checkvar23=tk.IntVar()
checkvar24=tk.IntVar()

a1=tk.Checkbutton(root,text='番茄',bd=8,font=16,variable=checkvar1,onvalue=1,offvalue=0)
a1.place(x=60,y=40)
a2=tk.Checkbutton(root,text='鸡蛋',bd=8,font=16,variable=checkvar2,onvalue=1,offvalue=0)
a2.place(x=60,y=80)
a3=tk.Checkbutton(root,text='土豆',bd=8,font=16,variable=checkvar3,onvalue=1,offvalue=0)
a3.place(x=60,y=120)
a4=tk.Checkbutton(root,text='芹菜',bd=8,font=16,variable=checkvar4,onvalue=1,offvalue=0)
a4.place(x=60,y=160)
a5=tk.Checkbutton(root,text='豆干',bd=8,font=16,variable=checkvar5,onvalue=1,offvalue=0)
a5.place(x=60,y=200)
a6=tk.Checkbutton(root,text='猪肉',bd=8,font=16,variable=checkvar6,onvalue=1,offvalue=0)
a6.place(x=60,y=240)
a7=tk.Checkbutton(root,text='冬瓜',bd=8,font=16,variable=checkvar7,onvalue=1,offvalue=0)
a7.place(x=240,y=40)
a8=tk.Checkbutton(root,text='虾皮',bd=8,font=16,variable=checkvar8,onvalue=1,offvalue=0)
a8.place(x=240,y=80)
a9=tk.Checkbutton(root,text='香菇',bd=8,font=16,variable=checkvar9,onvalue=1,offvalue=0)
a9.place(x=240,y=120)
a10=tk.Checkbutton(root,text='蘑菇',bd=8,font=16,variable=checkvar10,onvalue=1,offvalue=0)
a10.place(x=240,y=160)
a11=tk.Checkbutton(root,text='西蓝花',bd=8,font=16,variable=checkvar11,onvalue=1,offvalue=0)
a11.place(x=240,y=200)
a12=tk.Checkbutton(root,text='胡萝卜',bd=8,font=16,variable=checkvar12,onvalue=1,offvalue=0)
a12.place(x=240,y=240)
a13=tk.Checkbutton(root,text='排骨',bd=8,font=16,variable=checkvar13,onvalue=1,offvalue=0)
a13.place(x=420,y=40)
a14=tk.Checkbutton(root,text='豆腐',bd=8,font=16,variable=checkvar14,onvalue=1,offvalue=0)
a14.place(x=420,y=80)
a15=tk.Checkbutton(root,text='鸡肉',bd=8,font=16,variable=checkvar15,onvalue=1,offvalue=0)
a15.place(x=420,y=120)
a16=tk.Checkbutton(root,text='青椒',bd=8,font=16,variable=checkvar16,onvalue=1,offvalue=0)
a16.place(x=420,y=160)
a17=tk.Checkbutton(root,text='牛肉',bd=8,font=16,variable=checkvar17,onvalue=1,offvalue=0)
a17.place(x=420,y=200)
a18=tk.Checkbutton(root,text='黄瓜',bd=8,font=16,variable=checkvar18,onvalue=1,offvalue=0)
a18.place(x=420,y=240)
a19=tk.Checkbutton(root,text='木耳',bd=8,font=16,variable=checkvar19,onvalue=1,offvalue=0)
a19.place(x=600,y=40)
a20=tk.Checkbutton(root,text='蒜苗',bd=8,font=16,variable=checkvar20,onvalue=1,offvalue=0)
a20.place(x=600,y=80)
a21=tk.Checkbutton(root,text='鱼',bd=8,font=16,variable=checkvar21,onvalue=1,offvalue=0)
a21.place(x=600,y=120)
a22=tk.Checkbutton(root,text='虾',bd=8,font=16,variable=checkvar22,onvalue=1,offvalue=0)
a22.place(x=600,y=160)
a23=tk.Checkbutton(root,text='茄子',bd=8,font=16,variable=checkvar23,onvalue=1,offvalue=0)
a23.place(x=600,y=200)
a24=tk.Checkbutton(root,text='白菜',bd=8,font=16,variable=checkvar24,onvalue=1,offvalue=0)
a24.place(x=600,y=240)

photo1=tk.PhotoImage(file=r'.\锅.gif')
photo1=photo1.subsample(3,3)
b1=tk.Button(root,text='搁锅里头！',font=('FZSJ-AQMLTJW',16),fg='#FF4500',
    compound=tk.BOTTOM,command=cook,image=photo1,padx=5,pady=5)
b1.place(x=300,y=360)
b2=tk.Button(root,text='再来一次！',font=('FZSJ-AQMLTJW',16),fg='#8B4513',
    command=qingkong,padx=5,pady=5)
b2.place(x=350,y=520)
label=tk.Label(root,font=('FZZJ-XTJW',40))
label.place(x=240,y=600)

root.mainloop()

